package org.seckill.dao;

import org.apache.ibatis.annotations.Param;
import org.seckill.annotation.MyBatisDao;
import org.seckill.entity.SuccessKilled;

/**
 * Created by TheSixOneNine on 2017/2/8.
 * @author simple
 */
@MyBatisDao
public interface SuccessKilledDao {

    /**
     * 根据seckillId和userPhone来插入秒杀成功记录(即是购买明细)
     * @param seckillId
     * @param userPhone
     * @return int 插入的行数
     */
    int insertSuccessKilled (@Param("seckillId") long seckillId, @Param("userPhone") long userPhone);

    /**
     * 根据seckillId查询SuccessKilled并携带Seckill实体
     * @param seckillId
     * @param userPhone
     * @return SuccessKilled
     */
    SuccessKilled queryByIdWithSeckill (@Param("seckillId") long seckillId,@Param("userPhone") long userPhone);
}
